package com.zp.demo.repush.anno;

import com.zp.demo.repush.service.func.IsSucessFunc;
import com.zp.demo.repush.service.func.ReSubmitResultFunc;
import com.zp.demo.repush.service.func.StrategyKeyFunc;
import com.zp.demo.repush.service.impl.IsSucessNotNull;
import com.zp.demo.repush.service.impl.IsTrueStrategyKeyFunc;
import com.zp.demo.repush.service.impl.ReSubmitResultFunc4Result;
import org.springframework.core.annotation.AliasFor;
import org.springframework.web.bind.annotation.RequestMapping;

import java.lang.annotation.*;

@Target({ElementType.METHOD})//作用范围
@Retention(RetentionPolicy.RUNTIME)//系统运行得时候通过反射获取信息
@Documented//javadoc
@RePushAnno
public @interface RePushCutAnno {
	@AliasFor(annotation = RePushAnno.class)
	String value() default "";
	/**
	 * 中文描述
	 * @return
	 */
	@AliasFor(annotation = RePushAnno.class)
	String desc() default "";
	@AliasFor(annotation = RePushAnno.class)
	String app() default "app";

	boolean onlyOnce() default false;
	/**
	 * 判断结果成功的 接口
	 * @return
	 */
	@AliasFor(annotation = RePushAnno.class)
	Class<? extends IsSucessFunc> isOkClazz() default IsSucessNotNull.class;

	/**
	 * 策略
	 * @return
	 */
	Class<? extends StrategyKeyFunc> strategyKey() default IsTrueStrategyKeyFunc.class;


	/**
	 * 重复提交的，返回结果
	 * @return
	 */
	Class<? extends ReSubmitResultFunc> reSubmitResult() default ReSubmitResultFunc4Result.class;

}
